#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<map>

using namespace std;

int getValue(vector<int>& gifts, int n) 
{
    // write code here
    map<int, int> total;

    for (auto e : gifts)
    {
        total[e]++;
    }
    for (auto& e : total)
    {
        cout << e.first;
        if (e.second > n / 2)
        {
            return e.second;
        }
    }
    return 0;
}
int main()
{
    vector<int> gifts = { 1, 2, 3, 2, 2 };
    int n = 5;
    getValue(gifts, n);
    //cout << getValue(gifts, n);
    return 0;
}